<template>
	<view class="detailMsgBox">
		<view class="header">
			<view class="p1">
				券后￥
			</view>
			<view class="p2">{{detailsMsg.spec_data.skuList[0].tenure_months[12].every_day|| ""}}</view>
			<view class="p3">天起</view>
			<view class="p4">￥{{detailsMsg.spec_data.skuList[0].tenure_months[12].every_day_origin|| ""}}/天</view>
		</view>
		<view class="main">
			<view class="top">
				<view class="left">满3999减168</view>
				<view class="right" @click="onyouhuis">
					<view class="text">
						领取
					</view>
					<view class="icon"></view>
				</view>
			</view>
			<view class="name">
				<span class="quality">
					{{detailsMsg.type==1?"二手":"全新"}}
				</span>
				<span class="type">
					{{detailsMsg.operating_system==1?"苹果":"安卓"}}
				</span>
				{{detailsMsg.name}}
			</view>
			<view class="desc">
				<view>双卡双待</view>
				<view>顺丰包邮</view>
				<view>赠送壳膜</view>
			</view>
			<view class="desc_two" @click="goodsService">
				<view class="item">
					<view class="icon"></view>
					<view class="text">
						顺丰包邮
					</view>
				</view>
				<view class="item">
					<view class="icon"></view>
					<view class="text">
						设备服务
					</view>
				</view>
				<view class="item">
					<view class="icon"></view>
					<view class="text">
						配件齐全
					</view>
				</view>
				<view class="item">
					<view class="icon"></view>
					<view class="text">
						隐私清除
					</view>
				</view>
				<view class="more"></view>
			</view>
			<view class="depositBox">
				<view class="deposit">
					商品押金￥<span :style="detailsMsg.no_deposit=='1'?'text-decoration: line-through;':''"> {{detailsMsg.deposit}} </span>
				</view>
				<view class="day">
					1天起租
				</view>
			</view>
		</view>
		<u-popup :show="detailMsgPopupShow" @close="msgClose" @open="msgOpen" :round="30" :closeable="true">
			<view class="detailMsgPopupBox">
				<view class="d-top">
					商品服务
				</view>
				<view class="d-main">
					<view class="d-box">
						<view class="d-title">
							<view class="d-icon"></view>
							<view class="d-text">
								顺丰包邮
							</view>
						</view>
						<view class="d-p">
							寄出提供顺丰快递（或其他优质快递）包邮直达服务，让您更快时间收到货。
						</view>
						<view class="d-title">
							<view class="d-icon"></view>
							<view class="d-text">
								配件齐全
							</view>
						</view>
						<view class="d-p">
							在租期间，免费提供1套基础配件(具体配件见订单详情-商品配件)，租期到期后配件需要与设备一起归还;须知:订单有逾期情形的用户无法享受此服务:注意:若发现缺少配件，请联系商家客服协商处理，若情况属实，商家将包邮补发缺少的配件;
						</view>
						<view class="d-title">
							<view class="d-icon"></view>
							<view class="d-text">
								租赁服务设备
							</view>
						</view>
					</view>
				</view>
			</view>
		</u-popup>
	</view>
</template>
<script>
	export default {
		props: ['detailsMsg'],
		data() {
			return {
				detailMsgPopupShow: false,
			}
		},
		methods: {
			// 领券
			onyouhuis() {
				uni.navigateTo({
					url: "/pages/mys/preferential/preferential"
				})
			},
			//商品服务
			goodsService() {
				this.msgOpen()
			},
			msgClose() {
				this.detailMsgPopupShow = false
			},
			msgOpen() {
				this.detailMsgPopupShow = true
			}
		}
	}
</script>
<style scoped lang="scss">
	.detailMsgBox {
		width: 100%;
		height: 100%;
		position: relative;

		.header {
			width: 100%;
			height: 120rpx;
			background-image: url("/static/detail/detailmsg_1.png");
			background-size: cover;
			background-position: center;
			background-repeat: no-repeat;
			display: flex;
			align-items: baseline;
			line-height: 120rpx;

			>view {
				margin-left: 10rpx;
			}

			.p1 {
				margin-left: 20rpx;
			}

			.p2 {
				font-weight: bold;
				font-size: 40rpx;
			}

			.p4 {
				text-decoration: line-through;
			}
		}

		.main {
			width: 100%;
			height: 410rpx;
			position: absolute;
			border-radius: 20rpx 20rpx 0px 0px;
			position: absolute;
			left: 0;
			bottom: 0;
			background-color: white;
			display: flex;
			flex-direction: column;
			justify-content: space-around;
			align-items: center;

			.top {
				width: 90%;
				height: 100rpx;
				display: flex;
				justify-content: space-between;
				align-items: center;

				.left {
					background-color: rgba(242, 102, 98, 0.2);
					text-align: center;
					padding: 5rpx 10rpx;
					border-radius: 10rpx;
					font-size: 26rpx;
					color: #f26662;
					line-height: 40rpx;
				}

				.right {
					background-color: #f26662;
					padding: 7rpx 15rpx;
					display: flex;
					align-items: center;
					border-radius: 30rpx;

					.text {
						color: white;
						margin-right: 10rpx;
						font-size: 26rpx;
					}

					.icon {
						width: 20rpx;
						height: 20rpx;
						background-image: url("/static/detail/msg_right.png");
						background-size: cover;
					}
				}
			}

			.name {
				width: 90%;
				// height: 100rpx;
				font-size: 30rpx;
				font-weight: bold;
				line-height: 50rpx;
				overflow-y: scroll;

				.quality {
					font-size: 20rpx;
					background-color: #FCD748;
					padding: 5rpx 15rpx;
					border-radius: 5rpx;
				}

				.type {
					color: white;
					font-size: 20rpx;
					background-color: black;
					margin: 0px 10rpx;
					padding: 5rpx 10px;
					border-radius: 5rpx;
				}
			}

			.desc {
				width: 90%;
				display: flex;
				margin-top: 20rpx;

				>view {
					margin-right: 20rpx;
					font-size: 28rpx;
					color: #666666;
				}
			}

			.desc_two {
				width: 90%;
				height: 60rpx;
				background-color: #f9f9f9;
				margin-top: 20rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;

				.item {
					display: flex;
					align-items: center;
					margin-left: 15rpx;

					.icon {
						width: 20rpx;
						height: 20rpx;
						background-image: url("/static/detail/desc_two.png");
						background-size: cover;
						margin-right: 5rpx;
					}

					.text {
						font-size: 26rpx;
					}
				}

				.more {
					width: 20rpx;
					height: 20rpx;
					background-image: url("/static/detail/right_ccc.png");
					background-size: contain;
					margin-right: 10rpx;
				}
			}

			.depositBox {
				width: 90%;
				height: 60rpx;
				margin-top: 20rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;

				.deposit {
					font-size: 28rpx;
					color: #999999;
				}

				.day {
					font-size: 28rpx;
					color: #999999;
				}
			}
		}

		.detailMsgPopupBox {
			width: 100%;
			height: 70vh;
			display: flex;
			flex-direction: column;
			align-items: center;

			.d-top {
				font-size: 34rpx;
				font-weight: bold;
				margin-top: 50rpx;
			}

			.d-main {
				width: 90%;
				height: 90%;
				margin-top: 40rpx;
				overflow-y: scroll;

				.d-box {
					width: 100%;

					.d-title {
						display: flex;
						align-items: center;
						margin: 20rpx 0;

						.d-icon {
							width: 30rpx;
							height: 30rpx;
							background-image: url("/static/detail/desc_two.png");
							background-size: cover;
							margin-right: 20rpx;
						}

						.d-text {
							font-size: 32rpx;
							font-weight: bold;
						}
					}

					.d-title:not(:first-child) {
						margin-top: 50rpx;
					}

					.d-p {
						font-size: 28rpx;
						color: #666666;
					}
				}
			}
		}
	}
</style>